package com.sap.tpcd.policybuilder.policymodel ;


/**
 * @author I068988
 * @version 1.0
 * @created 30-sept.-2011 14:12:33
 */
public abstract class Policy {

	private String policyName;
	public PolicyElement m_PolicyElement;

	public Policy(){
	}

	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((m_PolicyElement == null) ? 0 : m_PolicyElement.hashCode());
		result = prime * result
				+ ((policyName == null) ? 0 : policyName.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof Policy)) {
			return false;
		}
		Policy other = (Policy) obj;
		if (m_PolicyElement == null) {
			if (other.m_PolicyElement != null) {
				return false;
			}
		} else if (!m_PolicyElement.equals(other.m_PolicyElement)) {
			return false;
		}
		if (policyName == null) {
			if (other.policyName != null) {
				return false;
			}
		} else if (!policyName.equals(other.policyName)) {
			return false;
		}
		return true;
	}

	/**
	 * @return the policyName
	 */
	public String getPolicyName() {
		return policyName;
	}

	/**
	 * @param policyName the policyName to set
	 */
	public void setPolicyName(String policyName) {
		this.policyName = policyName;
	}

	/**
	 * @return the m_PolicyElement
	 */
	public PolicyElement getM_PolicyElement() {
		return m_PolicyElement;
	}

	/**
	 * @param m_PolicyElement the m_PolicyElement to set
	 */
	public void setM_PolicyElement(PolicyElement m_PolicyElement) {
		this.m_PolicyElement = m_PolicyElement;
	}


}